import axios from "axios"
import { prefix } from "./index";
export const login = async(userName,userPwd)=>{
    let response = await axios({
        method: "get",
        url: prefix +"/user/" + userName + "/" + userPwd
    })
    return response.data;
}
export const register = async(user)=>{
    console.log(user)
    let response = await axios({
        method: "post",
        url: prefix +"/user",
        data: user
    })
    return response.data;
}
export const examine = async(userInfoCompanyName,userId)=>{
    let response = await axios({
        method: "post",
        url: prefix +"/userInfo",
        data: {userInfoCompanyName,userId}
    })
    return response.data;
}
export const findById = async(userId)=>{
    let response = await axios({
        method: "get",
        url: prefix +"/user/" + userId
    })
    return response.data;
}
export const getSession = async () => {
    let response = await axios({
        method: "get",
        url: prefix + "/user/getSession",
    })
    return response.data;
}
export const removeSession = async () => {
    let response = await axios({
        method: "get",
        url: prefix + "/user/removeSession",
    })
    return response.data;
}
